package com.lixinyue.exer2;

public class Account {
    private double banlance;
    public Account(double init_balance)
    {
        banlance=init_balance;
    }

    public double getBanlance() {
        return banlance;
    }
    public void deposit(double amt)
    {
        if(amt>0)
        {
            banlance+=amt;
            System.out.println("存储成功");
        }
    }
    public void withdraw(double amt)
    {
        if(banlance>amt)
        {
                banlance-=amt;
            System.out.println("取钱成功");
        }else
        {
            System.out.println("余额不足");
        }
    }
}
